<div class="col-md-8">
<div class="main-content" id="main-content">
	<div class="sub-content">
		<div class="top-header products clearfix">
			<div class="pull-left pad">
				<h1>Industry List</h1>
			</div>
			<div class="product-list-details">
				<a href="<? echo $this->Url('products')?>/industry"><input type="button" value="Add Industry" class="btn"/></a>
			</div>
		</div>
		<div class="product_table table-responsive">			
		</div>
	</div>
</div></div>
<script>
$(function(){
$('.product_table').html('Please wait loading....');
	$.ajax({
		type:'GET',
		dataType:'json',
		url: BASE_PATH+'/products/allindustries-ajax',
		success: function(data){
		$('.product_table').html('<table border="1" class="table table-bordered" cellpadding="0" cellspacing="0" width="100%" id="search_results"><thead><tr class="bg_header"><th>SNO</th><th>Industry Name</th><th>Category Name</th><th>Action</th></tr></thead><tbody></tbody></table>');	
			if(data!='1'){
				eval(data);
				var oTable = $('#search_results').dataTable( {
					aoColumnDefs: [{bSortable: false,
									aTargets: [ 0 ]
									}],
					"bStateSave": true,
					"bAutoWidth": true,
					"sRowSelect": "multi",
					"sPaginationType": "full_numbers",
					"bProcessing": true,
					"aaData": data,
					"aoColumns": [
						{ "mData": "sno" },
						{ "mData": "industryname" },
						{ "mData": "category_name" },
						{ "mData": "action" }						
					] 
				});
			}else{
				$('.product_table').html('No Industries...');	
			}					
		}
	});
});
function deleteIndustry(ind_id){
	if(confirm("Are you sure you want delete record?")){
		window.location=BASE_URL+"/products/delete-industry?industry_id="+ind_id;					
	}
}
</script>